<template>
  <el-progress type="circle" :percentage="percentage"></el-progress>
  <el-descriptions title="计算结果">
    <el-descriptions-item label="扣除费用">{{ ComputedTax.deductingFee }}</el-descriptions-item>
    <el-descriptions-item label="扣除费用后纳税所得额">{{ ComputedTax.afterDeductingTaxableIncomeAmount }}
    </el-descriptions-item>
    <el-descriptions-item label="适用税率">{{ ComputedTax.rate }}</el-descriptions-item>
    <el-descriptions-item label="实际税率">{{ ComputedTax.actualRate }}</el-descriptions-item>
    <el-descriptions-item label="速算扣除数">{{ ComputedTax.quickCalculateDeduction }}</el-descriptions-item>
    <el-descriptions-item label="税费">{{ ComputedTax.tax }}</el-descriptions-item>
    <el-descriptions-item label="税后收入">{{ ComputedTax.incomeAfterTax }}</el-descriptions-item>
    <el-descriptions-item label="消费者">{{ ComputedTax.consumer }}</el-descriptions-item>
    <el-descriptions-item label="生产者">{{ ComputedTax.provider }}</el-descriptions-item>
  </el-descriptions>
  <el-button type="danger" @click="back">返回</el-button>
</template>

<script>
import router from "@/router";

export default {
  data() {
    return {
      ComputedTax: {
        deductingFee: '',
        afterDeductingTaxableIncomeAmount: '',
        rate: '',
        actualRate: 0,
        quickCalculateDeduction: '',
        tax: '',
        incomeAfterTax: '',
        consumer: '',
        provider: ''
      },
      percentage: 0
    }
  },
  methods: {
    back() {
      this.$cookies.remove('data')
      router.push('/')
    }
  },
  mounted() {
    console.log(this.$cookies.get('data'))
    this.ComputedTax = this.$cookies.get('data')
    this.percentage = this.ComputedTax.actualRate.split('%')[0]
  }
}
</script>